import {api} from '@/api/api';

export default {
  getUserInfo (params, cb) {
    return api.post('/user/info', params, cb)
  },
  getUserId (params, cb) {
    return api.post('/weibo/userid', params, cb)
  },
  login(params, cb){
    return api.post4Data('/login', params, cb)
  },
  logout(params, cb){
    return api.get4Data('/login/out?target=' + params.jumpLink, params, cb)
  },
  getMediaData(params, cb){
    //https://apib.hd.xxx.com/v1/file/list?page=1&pageSize=20
    return api.post('/file/list', params, cb)
  },
  deleteMediaList(params, cb){
    //https://apib.hd.xxx.com/v1/file/del
    return api.post('/file/del', params, cb)
  },
  getMyLists(params, cb){
    //2.地址: https://apib.hd.xxx.com/v1/site/mylist
    return api.post('/site/mylist', params, cb)
  },
  saveImgToServer(params, cb){
    //https://apib.hd.xxx.com/v1/file/save
    return api.post('/file/save', params, cb)
  },
  getTelCode(params, cb) {
    return api.post4Data('/sms', params, cb)
  },
  regist(params, cb) {
    return api.post4Data('/user/reg', params, cb)
  },
  getSiteData(params, cb){
    return api.post('/site/get', params, cb)
  },
  onlineSite(params, cb){
    return api.post4Data('/site/online', params, cb)
  },
  deleteSite(params, cb) {
    return api.post4Data('/site/del', params, cb)
  },
  getTempPreviewUrl(params, cb) {
    //https://apib.hd.xxx.com/v1/site/preshow?site_id=103
    return api.post('/site/preshow', params, cb)
  },
  //https://apib.hd.xxx.com/v1/feinit/share?url=xxxxxxx

  //https://apib.hd.xxx.com/v1/weibo/userid
  getDataAll(params, cb) {
    return api.post4Data('/site/mydata', params, cb)
  },
  getNavPrev(params, cb) {
    return api.post4Data('/stat/NavPrev', params, cb)
  },
  exportDataTotal(params, cb) {
    // 1.https://apib.hd.xxx.com/v1/stat/expdatatotal
    return api.post('/stat/expdatatotal', params, cb)
  },
  exportData(params, cb) {
    return api.post('/stat/expdata', params, cb)
  },
  recoverSiteQrcode(params, cb){
    ///v1/site/qrcoderefresh?site_id=1
    return api.post('/site/qrcoderefresh', params, cb)
  },
  getClickStatics(params, cb){
    // /v1/stat/clickmap?site_id=396&num=7
    //clickmap接口,,num为7天内的数据,,前台那给个下拉,选择1,3,7,如果没设置num就是截止目前所有的点击
    return api.post('/stat/clickmap', params, cb)
  },
  setTemp(params, cb) {
    return api.post('/site/cpto', params, cb)
  },
  getTempLists(params, cb) {
    return api.post('/site/tmpllist', params, cb)
  },
  getFormDataTable(params, cb){
    //https://apib.hd.xxx.com/V1/stat/formlist
    return api.post('/stat/formlist', params, cb)
  },
  getPromtLists(params, cb) {
    return api.post('/stat/promt_list', params, cb)
  },
  addPromt(params, cb) {
    return api.post('/stat/promt_add', params, cb)
  },
  markFormItem(params, cb){
    // https://apib.hd.xxx.com/v1/stat/formdel?site_id=2484&id=31320                软删除,del=-1
    return api.post('/stat/formdel', params, cb)
  },
  deleteFormItem(params, cb){
    params.operate = 'real'
    // https://apib.hd.xxx.com/v1/stat/formdel?site_id=2484&id=31320&operate=real   物理删除
    return api.post('/stat/formdel', params, cb)
  },
  getDictionaryTree(params, cb) {
    return api.post('/dictionary/tree', params, cb)
  },
  getMySite4Data(params, cb) {
    return api.post('/site/mysite', params, cb)
  },
  getPromtDay(params, cb) {
    return api.post('/stat/promt_day', params, cb)
  },
  resetPassword(params, cb) {
    return api.post4Data('/login/reset', params, cb)
  },
  addTag(params, cb) {
    return api.post4Data('/site/addSiteTag', params, cb)
  },
  deleteTag(params, cb) {
    return api.post4Data('/site/delSiteTag', params, cb)
  },
  getSearchTagList(params, cb) {
    return api.post4Data('/tag/list', params, cb)
  },

  // TODO:
  getTaglist(params, cb) {
    return api.post4Data('/site/getTaglist', params, cb)
  },
}
